#include<stdio.h>
#include<math.h>
enum {N=100};
double f(double x)
{
	return x*x;
}
double integrate_f(double a,double b)
{
	double dx=(b-a)/N,sum=0;
	int i;
	for(i=0;i<N;i++)
	{
		sum+=(f(i*dx+a)+f((i+1)*dx+a))*dx/2;
	}
	return sum;
}
double integrate_sin(double a,double b)
{
	double dx=(b-a)/N,sum=0;
	int i;
	for(i=0;i<N;i++)
	{
		sum+=(sin(i*dx+a)+sin((i+1)*dx+a))*dx/2;
	}
	return sum;
}
int main()
{

	printf("%.3f\n",integrate_f(0,1));
	printf("%.3f\n",integrate_sin(0,1));
	return 0;
}